

*Set working directory
cd "/path/to/replication"

*Open data
import delimited "data/hate_crimes_classified.csv", clear

* Figure B1 - Plot hate crimes categories
	
	*Origin
	gen n_hc=1
	
	graph bar (sum) n_hc, over(region_broad, label(angle(45))) scheme(plotplainblind) ytitle("Number of hate crimes", size(LARGE)) ///
						bar(1,fcolor(gray) lcolor(black) fintensity(20)) 
	graph export "desc_mean_nationality.pdf", as(pdf) replace
		
	*Type of violence
	gen etype="Verbal violence" if atti=="violenze-verbali"
	replace etype="Physical violence" if atti=="violenze_fisiche"
	replace etype="Discrimination" if atti=="discriminazioni"
	replace etype="Property damages" if atti=="danni-contro-le-proprieta-o-le-cose"
	
	graph bar (sum) n_hc, over(etype) scheme(plotplainblind) ytitle("Number of hate crimes", size(medsmall)) ///
						bar(1,fcolor(gray) lcolor(black) fintensity(20)) 
	graph export "desc_mean_type_event.pdf", as(pdf) replace
	
	*Attacker
	gen attacker="Society" if perpetratori=="gruppi"|perpetratori=="singoli"|perpetratori=="individui-singoli"|perpetratori=="personaggi-dello-sport-e-tifoserie"
	replace attacker="Politics" if perpetratori=="partiti"
	replace attacker="Media" if perpetratori=="operatori-dei-media"
	replace attacker="Institutions" if perpetratori=="attori-istituzionali"
				
	graph bar (sum) n_hc, over(attacker, label(angle(45))) scheme(plotplainblind) ytitle("Number of hate crimes", size(medsmall)) ///
						bar(1,fcolor(gray) lcolor(black) fintensity(20)) 
	graph export "desc_mean_source.pdf", as(pdf) replace
